<template>
  <div class="swiper">
    <swiper :options="swiperOption">
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img :src="item.imgUrl" alt="Banner">
      </swiper-slide>
      <!--分页器-->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  props: ['swiperList'],
  data () {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination'
        },
        autoplay: {
          delay: 3000,
          stopOnLastSlide: false,
          disableOnInteraction: false
        },
        loop: true
      }
    }
  }
}
</script>

<style scoped lang="stylus">
.swiper
  width: 100%
  height: 0
  background-color: #eee
  padding-bottom: 26.666%
  img
    width: 100%
    height: 100%
  >>>.swiper-pagination-bullet-active  /* 样式穿透 */
    opacity: 1
    background: #fff
  >>>.swiper-pagination-bullet
    width: 6px
    height: 6px
</style>
